<script type="text/javascript">
	$(function() {
	    $.fn.dataGridOptions.formSubFun("#form",'/modules/additional/experienceBorrow/doModify.html',"修改成功！","修改失败！");
	});
</script> 
<form id="form"  method="post">
<div class="popForm sForm">
   	<input type="hidden" name="id" value="${experienceBorrow.id}">
   	<input type="hidden" name="borrow.id" value="${experienceBorrow.borrow.id}">
   	<input type="hidden" name="account" value="${experienceBorrow.account}">
	<div class="formitm">
		<label class="lab">借款标：</label>
		<div class="ipt">${experienceBorrow.borrow.name}</div>
	</div>
	<div class="formitm">
		<label class="lab">借款金额：</label>
		<div class="ipt">${experienceBorrow.account}</div>
	</div>
	<div class="formitm">
		<label class="lab">最大额度：</label>
		<div class="ipt">
			<input type="text" name="mostExperience" value="${experienceBorrow.mostExperience}" style="width:60px;" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" class="mostExperience easyui-validatebox int_figure_required" data-options="required: true, validType:'integerRange[1, 100000]'" maxlength="6">元
			<span class="sweet_tips"></span>
			
		</div>
	</div>
	<div class="formitm">
		<label class="lab">单人额度：</label>
		<div class="ipt"><input type="text" name="mostExperienceSingle" value="${experienceBorrow.mostExperienceSingle}" style="width:60px;" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" class="mostExperienceSingle easyui-validatebox int_figure_required" data-options="required: true, validType:'integerRange[1, 100000]'"  maxlength="6">元</div>
	</div>
</div>
</form>

<script>

	//	输入框要求必须为整数数字
	$('.int_figure_required').bind('keyup blur', function() {			
	   	// 不能输入 类似00、01、0000001的数值
		if($(this).val().match(/^0+\d+/)){
	       this.value = $(this).val().replace(/^0+(\d+)/, '$1');
	   	}
	});


	//	最大额度不能小于单人额度
	function minMax(obj,maxVal,minVal,maxTips,minTips){
		if(maxVal < minVal){
			console.log("小了");
			$(".mostExperience").parent().parent().find(".sweet_tips").html("  * "+maxTips+"不能小于"+minTips);
			return false;
		}
	}
	
	$(".mostExperience").on({
		blur: function(){
			if($(".mostExperience").val() != '' && $(".mostExperienceSingle").val() != ''){	
				minMax($(".mostExperience"),parseInt($(".mostExperience").val()),parseInt($(".mostExperienceSingle").val()),"最大额度","单人额度");	
			}
		},
		focus: function(){
			$(this).parent().find(".sweet_tips").html('');
		}
	});
	$(".mostExperienceSingle").on({
		blur: function(){
			if($(".mostExperience").val() != '' && $(".mostExperienceSingle").val() != ''){
				minMax($(".mostExperienceSingle"),parseInt($(".mostExperience").val()),parseInt($(".mostExperienceSingle").val()),"最大额度","单人额度");
			}
		},
		focus: function(){
			$(".mostExperience").parent().find(".sweet_tips").html('');
		}
	});
</script>